Repository navigation
Conversation
|
This is too complicated and overengineered for a public example. It doesn't show Simplex in the best light. A lot of complexity can be removed by making covenant public keys as arguments (instead of hardcoding them to G, 2G, 3G), and following the regular |
57a5e5d to
5cd0789
Compare
|
Hi @Arvolear, I've attempted to do that here. Could you have another look at this version? |
|
@Arvolear Hopefully now somewhat better idiomaticity and use of the SDK throughout these tests. |
9458406 to
7d6c0c8
Compare
|
Some fixes for the upstream 0.1.0 release (API change and a merge conflict), and also Note that this still adds a public wasm wrapper for |
| [dependencies] | ||
| smplx-std = { path = "../../crates/simplex" } | ||
|
|
||
| anyhow = { version = "1.0.101" } |
There was a problem hiding this comment.
| anyhow = { version = "1.0.101" } | |
| anyhow = { version = "1.0.104" } |
| smplx-std = { path = "../../crates/simplex" } | ||
|
|
||
| anyhow = { version = "1.0.101" } | ||
| bitcoin_hashes = { version = "0.14" } |
There was a problem hiding this comment.
This one is probably not needed anymore.
| /// Returns an error if the transaction cannot be blinded or signed, if a witness cannot be injected | ||
| /// at the requested path, or if a covenant input does not execute. | ||
| #[wasm_bindgen(js_name = signTransaction)] | ||
| pub fn sign_transaction(&self, builder: &TransactionBuilder) -> Result<SignedTransaction, JsError> { |
There was a problem hiding this comment.
Let's do this change in a separate PR. Otherwise, this one has to go in the dev branch.
| the fee and continuation outputs swapped. A change target cannot produce | ||
| those shapes, because Simplex always appends change first and fee second, | ||
| so those tests list their outputs directly and sign with `Signer::sign_tx`, | ||
| which appends nothing. |
There was a problem hiding this comment.
| which appends nothing. | |
| which doesn't append anything. |
This uses the old `Either` style instead of the experimental `enum` version, because `enum` currently doesn't work under Simplex. The tests add some detailed information about what they're trying to accomplish and what happened, visible when they're run with `simplex test -v` In addition to learning more about Simplex, new users will understand a little more about Simplicity covenants.
Instead of hard-coding privkeys 1, 2, 3 and writing new signer logic, use proper wallet mnemonics and Simplex's built-in tools for this. Also tighten comments and narration.
- Program inputs take an Option<ProgramSignature>, so the spend path builds
ProgramSignature::new("INHERIT_OR_NOT").at_path(..) in place of
RequiredSignature::witness_with_path.
- A program that rejects a spend now surfaces as
SignerError::Program(ProgramError::ProgramExecution { .. }), which the
local-rejection tests match on.
- UTXO::amount() returns a Result, so the lifecycle test propagates it.
- Signed transactions are extracted with .extract_tx().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derived from examples/basic/Cargo.lock, so the example resolves to the same dependency versions as the rest of the workspace, including the pinned proptest 1.12.0. Only the root package entry differs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7d6c0c8 to
bc4982a
Compare
This uses the old
Eitherstyle instead of the experimentalenumversion, becauseenumcurrently doesn't work under Simplex.The tests add some detailed information about what they're trying to accomplish and what happened, visible when they're run with
simplex test -vIn addition to learning more about Simplex, new users will understand a little more about Simplicity covenants.